# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Omar Sandoval <osandov at cs dot washington dot edu>
# Contributor: Alexander Slesarev <slesarew at gmail dot com>

pkgname=python-gmpy2
pkgver=2.1.5
pkgrel=2
pkgdesc='Provides C-coded Python modules for fast multiple-precision arithmetic'
arch=(loong64 x86_64)
url='https://github.com/aleaxit/gmpy'
license=(LGPL2.1)
depends=(python libmpc)
makedepends=(python-build python-installer python-setuptools python-wheel)
source=(https://github.com/aleaxit/gmpy/archive/refs/tags/gmpy2-$pkgver.tar.gz)
sha256sums=('67ef729ff8e7f501e3f23324058386bac3fe0dea9b460317b27bde579c7cfbd5')

build() {
  cd gmpy-gmpy2-$pkgver
  python -m build --wheel --no-isolation
}

package() {
  cd gmpy-gmpy2-$pkgver 
  python -m installer --destdir="$pkgdir" dist/*.whl
 
  install -d -m 755 $pkgdir/usr/share/doc/$pkgname
  install -m 644 -t $pkgdir/usr/share/doc/$pkgname docs/*
}
